home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Sunday Times: The Month 2003 September
/
The Sunday Times - The Month 2003-09.iso
/
mac
/
The Month SEP 03
/
assets
/
modules
/
print
/
print.swf
/
scripts
/
frame_1
/
DoAction.as
Wrap
Text File
|
2003-08-12
|
3KB
|
112 lines
function loadImage(mc, node, extrapath)
{
extrapath != null ? 0 : (extrapath = "");
var strDefaultPath = Tardis.ASSETS_FOLDER + "images/" + Tardis.ActiveSection.id + "/";
var strImg = node.getText();
var diffpath = node.attributes.path;
if(diffpath != null)
{
strImg = diffpath + strImg;
}
else
{
strImg = strDefaultPath + extrapath + strImg;
}
strPathPrefix != null ? 0 : (strPathPrefix = "");
mc.loadMovie(strPathPrefix + strImg);
}
function addLink(mc)
{
Links[mc.link] = mc;
}
function getMCfromLink(Item)
{
if(Links[Item] == null)
{
var arr = [];
while(Item != sideMenu.ItemHome)
{
arr.unshift(Item._name.split("_").pop());
Item = Item._parent._parent;
}
var str = arr.join("/");
Links[Item] = Links[str];
}
return Links[Item];
}
function init()
{
var strID = Tardis.ActiveSection.id;
var Colors = Tardis.Colors;
var strColor = Colors.getString(strID);
SECTION_COLOR = Colors.getHex(strID);
SECTION_COLOR50 = Colors.getHex(strID + "50");
DEFAULT_COLOR = Colors.getHex("default");
IMAGE_PATH = nodeData.attributes.imagepath;
THUMB_PATH = nodeData.attributes.thumbpath;
var mcToDisplay = "clip" + nodeData.childNodes.length + "MC";
attachMovie(mcToDisplay,"mc_module",Tardis.depth++);
mc_module._x = 10;
mc_module._y = 10;
}
function txtOver(mc)
{
mc.gotoAndStop("over");
Tardis.sideMenu.doOver(mc.link);
}
function txtOut(mc)
{
mc.gotoAndStop("off");
Tardis.sideMenu.doOut(mc.link);
}
function txtUp(mc)
{
Tardis.sideMenu.doUp(mc.link);
printImage(mc.imageToPrint);
}
function doOver(mc)
{
mc.gotoAndStop("over");
}
function doOut(mc)
{
mc.gotoAndStop("off");
}
function positionElements(mc)
{
mc.activeBtn._height = mc._height;
mc.titleFF._y = mc.imgToCheck._height;
mc._visible = true;
mc.printFF._visible = true;
}
function printImage(strFile)
{
if(System.capabilities.os.toUpperCase().indexOf("MAC OS 9") != -1)
{
lingo("Flsh_alert \"Sorry, this functionality is not available on Mac OS 9\"");
return undefined;
}
var strPath = Tardis.ASSETS_FOLDER + "images/" + Tardis.ActiveSection.id + "/" + IMAGE_PATH;
imgPrint = false;
nmWaitID = setInterval(this,"checkImage",500);
mc_image.printImageMC.loadMovie(strPath + strFile);
}
function checkImage()
{
if(mc_image.printImageMC._height > 0 && !imgPrint)
{
imgPrint = true;
clearInterval(nmWaitID);
getURL("printasbitmap:",mc_image.printImageMC);
}
}
Links = {};
Tardis.sideMenu.EB.addListener(this);
this.onUnload = function()
{
this.onUnload = null;
Tardis.sideMenu.EB.removeListener(this);
};
stop();
onReady();